var btn = document.querySelector('.sidebar-fixed-wrapper');

window.onscroll = function(){
    if(scrollY >= 1000){
        btn.style.display = 'block';
    }else{
        btn.style.display = 'none';
    }
}

var timer;

btn.onclick = function(){
    clearInterval(timer);

    timer = setInterval (function(){
        if(scrollY <= 0){
            clearInterval(timer)
        }
        scrollTo({top:scrollY - 300})
    },50);
}